

public class Account {
    //将不能修改的属性按private修饰
    private String cardNo;
    private double money;
    public void setCardNo(String cardNo){
        this.cardNo=cardNo;
    }
    public void setMoney(double money){
        this.money=money;
    } 
    
    public void addMoney(){
        this.money+=money;
    }
    public String getCardNo(){
        return cardNo;
    }
    public double getMoney(){
        return money;
    }
    public void show(){
        System.out.println("卡号："+cardNo+"，金额："+money);
    }
}
